#include "dialog.h"
#include "ui_dialog.h"
#include "mainwindow.h"
#include "searchwin.h"
#include "id.h"
#include "setedit.h"
#include "askmoney.h"
#include "endprogram.h"
#include "addprogram.h"
#include "bigsave.h"
#include <vector>
#include "teacher.h"
#include "student.h"
#include "program.h"
#include "paper.h"
#include "addpaper.h"
extern id u;
extern int l;
extern vector <Teacher*> tdata;
extern vector <student*> sdata;
extern vector <paper*> pdata;
extern vector <Program*> prdata;
Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
    ui->label->setText(u.str1);
}

Dialog::~Dialog()
{
    delete ui;
}



void Dialog::on_pushButton_7_clicked()
{
    closeEvent(0);
    MainWindow*mainwindow=new(MainWindow);
    mainwindow->show();
}

void Dialog::on_pushButton_5_clicked()
{
    searchwin*p=new(searchwin);
    p->show();
    this->hide();
}

void Dialog::on_pushButton_6_clicked()
{
    setedit*p=new(setedit);
    p->show();
    this->hide();
}

void Dialog::on_pushButton_4_clicked()
{
    askmoney *p = new askmoney;
    p->show();
    this->hide();
}

void Dialog::on_pushButton_2_clicked()
{
    endprogram*p=new endprogram;
    p->show();
    this->hide();
}

void Dialog::on_pushButton_clicked()
{
    addprogram*p=new (addprogram);
    p->show();
    this->close();
}

void Dialog::on_pushButton_3_clicked()
{
    this->close();
    addpaper*p=new(addpaper);
    p->show();
}
